﻿using Microsoft.EntityFrameworkCore;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Threading.Tasks;
using FurnitureDesign.Core.Models;

namespace FurnitureDesign.EFCore.Controllers.Infrastructure
{
    public static class ModelBuilderExtensions
    {
        public static void Seed(this ModelBuilder modelBuilder)
        {
            modelBuilder.Entity<ProductType>().HasData(
                new ProductType
                {
                    Id = 1,
                    ProductTypeName = "椅子"
                },
                  new ProductType
                  {
                      Id = 2,
                      ProductTypeName = "餐桌"
                  },
                   new ProductType
                   {
                       Id = 3,
                       ProductTypeName = "沙发"
                   }
                );
            modelBuilder.Entity<Product>().HasData(
               new Product
               {
                   Id = 1,
                   ProductName = "软皮椅",
                   ProductmMterial = "真皮",
                   Price = "580",
                   MarketValue = "600",
                   Brand = "xxx",
                   Colour="红色",
                   ProductTypeId=1
               },
                new Product
                {
                    Id = 2,
                    ProductName = "硬皮椅",
                    ProductmMterial = "真皮",
                    Price = "300",
                    MarketValue = "350",
                    Brand = "xxx",
                    Colour = "红色",
                    ProductTypeId = 1
                },
                new Product
                {
                    Id = 3,
                    ProductName = "餐桌椅",
                    ProductmMterial = "真皮",
                    Price = "2000",
                    MarketValue = "2200",
                    Brand = "xxx",
                    Colour = "红色",
                    ProductTypeId = 2
                },
                new Product
                {
                    Id = 4,
                    ProductName = "餐桌爱心椅",
                    ProductmMterial = "真皮",
                    Price = "2500",
                    MarketValue = "2800",
                    Brand = "xxx",
                    Colour = "红色",
                    ProductTypeId = 2
                },
                new Product
                {
                    Id = 5,
                    ProductName = "软沙发",
                    ProductmMterial = "真皮",
                    Price = "9999",
                    MarketValue = "9999",
                    Brand = "xxx",
                    Colour = "红色",
                    ProductTypeId = 3
                },
                new Product
                {
                    Id = 6,
                    ProductName = "硬沙发",
                    ProductmMterial = "真皮",
                    Price = "5698",
                    MarketValue = "5899",
                    Brand = "xxx",
                    Colour = "红色",
                    ProductTypeId = 3
                }
               );
            modelBuilder.Entity<RealInfoType>().HasData(
               new RealInfoType
               {
                   Id = 1,
                   RealInfoTypeName = "新闻资讯"
               },
               new RealInfoType
               {
                   Id = 2,
                   RealInfoTypeName = "化工资讯"
               },
               new RealInfoType
               {
                   Id = 3,
                   RealInfoTypeName = "汽车资讯"
               }
              );
            modelBuilder.Entity<RealInfo>().HasData(
               new RealInfo
               {
                   Id = 1,
                   RealInfoName = "人民资讯聚合分发构建价值内容生态",
                   Content = @"2021年7月21日，人民网发布《人民网“十四五”发展规划》将“做精内容主业”作为“十四五”时期的重点任务之一，特别提出全力发展新型内容业务，运用新一代人工智能与大数据、云计算等技术，聚合主流媒体、各类机构以及社会创作力量的优质内容，面向政府、企业、机构应用场景，为各类传播终端和智能产品提供“内容批发市场”分发服务，该服务由人民科技全面负责。",
                   RealInfoTypeId = 1
               },
               new RealInfo
               {
                   Id = 2,
                   RealInfoName = "AI智能分发驱动“信息找人”，加深优质内容链接",
                   Content = @"优质内容更需要全方位的推荐和分发，扩大其影响价值。百度移动生态的“搜索+推荐”为服务化打造双引擎能力基础，通过百度AI技术加持，不仅为用户提供个性化的信息，还实现了从“人找信息”转向“信息找人”，实现精准分发。",
                   RealInfoTypeId = 1
               },
               new RealInfo
               {
                   Id = 3,
                   RealInfoName = "化工板块下跌 部分产品价格回调",
                   Content = @"近期，化工板块指数出现持续调整。同花顺数据显示，9月29日，申万化工指数收报4888点，下跌4.13%，相比16日高点下跌16.92%。但相比于年初，板块上涨约33.95%。
                             从个股走势看，湖北宜化、安纳达等多只个股当日跌停，而此前上述公司股价一度表现强势。以湖北宜化为例，9月14日一度上探至27.9元高点，截至29日收盘，回调幅度约35 % (前复权，下同)，但相比于年初涨幅仍超4倍；安纳达股价年内同样出现大幅上涨，但近期股价急跌，连续三个交易日跌停。
                             东莞证券认为，化工行业企业能耗较高，由于限产等状况的出现，引发市场对于化工企业开工率和后续产销量的担忧，导致了板块出现下跌。",
                   RealInfoTypeId = 2
               },
               new RealInfo
               {
                   Id = 4,
                   RealInfoName = "中化资本创投领投天一化学助力山东化工产业升级",
                   Content = @"近日，中化资本旗下中化资本创投作为领投方，完成对山东天一化学股份有限公司(简称天一化学)的战略投资。
                             天一化学为国家高新技术企业、省级“专精特新”企业，是山东省现代海洋领军民企十强，公司业务领域覆盖阻燃剂、水性功能单体、均相离子交换膜等板块。
                             天一化学目前为国内溴系阻燃剂行业龙头企业，产品品类齐全，结构合理，拥有梯度明确的高分子溴系阻燃剂、十溴系列阻燃剂产品，是国内产品种类最齐全的溴系阻燃剂供应商。公司的均相离子交换膜业务拥有完全自主知识产权，曾获国家技术发明二等奖，牵头制定化工行业标准3项，主持承担包括2项国家“863”计划在内的多项科技计划。公司的水性功能单体产品双丙酮丙烯酰胺(DAAM)，主要用于生产交联剂和聚氨酯分散剂，产品己二酸二酰肼(ADH)，用于环氧粉末涂料固化剂和涂料助剂。
                             本次股权合作协同效应突出，天一化学是中国中化旗下工程塑料业务产业链上企业，中化资本创投旗下中化绿色基金以及中化高新基金作为本轮联合领投方，将充分嫁接中国中化在材料科学领域的领先优势，搭建更多业务合作的桥梁。中化资本创投将利用中国中化产业资源优势协助天一化学补充新型磷系阻燃剂业务及扩产环保型阻燃剂产品，助力天一化学产品创新及产业升级。",
                   RealInfoTypeId = 2
               },
               new RealInfo
               {
                   Id = 5,
                   RealInfoName = "售21.99万元起 小鹏P7新增车型上市",
                   Content = @"两款新增车型的主要变化在续航和配置上，相较之前的智行版， 480G/670G增加了12项舒适性功能/配置，如智能车语、主驾记忆+通风+电动腰托、前排座椅加热、手机无线充电、前/后排头部气囊、前向碰撞预警FCW等，在降低起售价的同时，增加舒适性及安全性配置。
                             此外，今后小鹏P7的命名原则改为 车型+NEDC续航+智能梯度+特殊版型， 如原后驱长续航智享版，更名后为586N， 原车型名不再保留，全系统一。后缀PENG为智能梯度划分，分别对应P（Premium）高配，高贵版，为目前在售智能配置最高版本，以此类推为E（Elite）次高配，菁英版；N（Novel）中配，创新版；G（Glamorous）标配，独特版。 ",
                   RealInfoTypeId = 3
               },
               new RealInfo
               {
                   Id = 6,
                   RealInfoName = "2021天津车展：极狐阿尔法S华为HI版",
                   Content = @"作为与华为联合打造的产品，该车车内最大的亮点莫过于那块20.3英寸的大屏，它将仪表盘、中控大屏和副驾屏幕汇集到了一起，4K的分辨率支持高清视频的播放，并且这块屏幕在防眩、反射方面也做了处理。得益于华为鸿蒙操作系统，阿尔法S车机系统也融入了多种应用生态供用户使用。",
                   RealInfoTypeId = 3
               }
              );
            modelBuilder.Entity<User>().HasData(
              new User
              {
                  Id = 1,
                  Name = "小白",
                  Sex="女",
                  Age=16,
                  IDNumber="45896321546954863",
                  Phone = "12345678945",
                  Password="123456",
                  Email="1245@qq.com"
              },
               new User
               {
                   Id = 2,
                   Name = "大白",
                   Sex = "男",
                   Age = 17,
                   IDNumber = "45896321546954863",
                   Phone = "12345678945",
                   Password = "123456",
                   Email = "1245@qq.com"
               },
                new User
                {
                    Id = 3,
                    Name = "冰冰",
                    Sex = "女",
                    Age = 15,
                    IDNumber = "45896321546954863",
                    Phone = "12345678945",
                    Password = "123456",
                    Email = "1245@qq.com"
                },
                 new User
                 {
                     Id = 4,
                     Name = "花花",
                     Sex = "男",
                     Age = 18,
                     IDNumber = "45896321546954863",
                     Phone = "12345678945",
                     Password = "123456",
                     Email = "1245@qq.com"
                 }
             );
            modelBuilder.Entity<Designer>().HasData(
             new Designer
             {
                 Id = 1,
                 DesignerName = "史密斯KIM",
                 Sex = "男",
                 Age = 28,
                 Segment = "首席金牌设计师"
             },
             new Designer
             {
                 Id = 2,
                 DesignerName = "刘凯丽",
                 Sex = "女",
                 Age = 25,
                 Segment = "首席金牌设计师"
             },
             new Designer
             {
                 Id = 3,
                 DesignerName = "小李子",
                 Sex = "男",
                 Age = 32,
                 Segment = "首席金牌设计师"
             },
             new Designer
             {
                 Id = 4,
                 DesignerName = "Lisa",
                 Sex = "女",
                 Age = 27,
                 Segment = "首席金牌设计师"
             }
            );
            modelBuilder.Entity<Message>().HasData(
             new Message
             {
                 Id = 1,
                 MessageName = "菲菲",
                 MessageContent = "很漂亮",
                 ReplyContent = "感谢支持",
                 MessageTime = "2021-01-02",
                 ReplyTime="2021-03-08",
                 State="已回复"
             },
             new Message
             {
                 Id = 2,
                 MessageName = "琳琳",
                 MessageContent = "很漂亮",
                 ReplyContent = "",
                 MessageTime = "2021-01-02",
                 ReplyTime = "",
                 State = "未回复"
             },
             new Message
             {
                 Id = 3,
                 MessageName = "敏敏",
                 MessageContent = "很漂亮",
                 ReplyContent = "感谢支持",
                 MessageTime = "2021-01-02",
                 ReplyTime = "2021-03-08",
                 State = "已回复"
             },
             new Message
             {
                 Id = 4,
                 MessageName = "蹦蹦",
                 MessageContent = "很漂亮",
                 ReplyContent = "感谢支持",
                 MessageTime = "2021-01-02",
                 ReplyTime = "2021-03-08",
                 State = "已回复"
             },
             new Message
             {
                 Id = 5,
                 MessageName = "红红",
                 MessageContent = "很漂亮",
                 ReplyContent = "",
                 MessageTime = "2021-01-02",
                 ReplyTime = "",
                 State = "未回复"
             },
             new Message
             {
                 Id = 6,
                 MessageName = "哈哈",
                 MessageContent = "很漂亮",
                 ReplyContent = "",
                 MessageTime = "2021-01-02",
                 ReplyTime = "",
                 State = "未回复"
             },
             new Message
             {
                 Id = 7,
                 MessageName = "水水",
                 MessageContent = "很漂亮",
                 ReplyContent = "感谢支持",
                 MessageTime = "2021-01-02",
                 ReplyTime = "2021-03-08",
                 State = "已回复"
             },
             new Message
             {
                 Id = 8,
                 MessageName = "欢欢",
                 MessageContent = "很漂亮",
                 ReplyContent = "",
                 MessageTime = "2021-01-02",
                 ReplyTime = "",
                 State = "未回复"
             }
            );
        }
    }
}
